"""\
ObjectSaveToFile(filePath, obj)
    Save a python object into file.

ObjectSaveToFile(filePath, obj)
    Load a python object from file.
"""

import cPickle

def ObjectSaveToFile(filePath, obj):
    """\
ObjectSaveToFile(filePath, obj)
    Save a python object into file.

    Parameters:
        filePath     ( type = string )
        obj          ( type = any python object like dict )"""
    fileGen = open(filePath, 'w')
    cPickle.dump(obj, fileGen, True)
    fileGen.close()

def ObjectLoadFromFile(filePath):
    """\
ObjectSaveToFile(filePath, obj)
    Load a python object from file.

    Parameters:
        filePath     ( type = string )
    Returns:
        obj          ( type = any python object like list, dict )"""
    fileRead = open(filePath, 'r')
    obj = cPickle.load(fileRead)
    fileRead.close()
    return obj
